webpackJsonp([14],{

/***/ "1OdM":
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),

/***/ "hdfA":
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });

// EXTERNAL MODULE: ./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js
var helpers_extends = __webpack_require__("4YfN");
var extends_default = /*#__PURE__*/__webpack_require__.n(helpers_extends);

// EXTERNAL MODULE: ./node_modules/_babel-runtime@6.26.0@babel-runtime/regenerator/index.js
var regenerator = __webpack_require__("lC5x");
var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);

// EXTERNAL MODULE: ./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__("KH7x");
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);

// EXTERNAL MODULE: ./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__("J0Oq");
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);

// EXTERNAL MODULE: ./node_modules/_lodash@4.17.11@lodash/lodash.js
var lodash = __webpack_require__("psq8");
var lodash_default = /*#__PURE__*/__webpack_require__.n(lodash);

// EXTERNAL MODULE: ./src/apps/special-work/index.gql
var special_work = __webpack_require__("kIR6");
var special_work_default = /*#__PURE__*/__webpack_require__.n(special_work);

// EXTERNAL MODULE: ./src/common/api/commonApi.js
var commonApi = __webpack_require__("+/+p");

// CONCATENATED MODULE: ./node_modules/_babel-loader@7.1.5@babel-loader/lib!./node_modules/_vue-loader@13.7.3@vue-loader/lib/selector.js?type=script&index=0!./src/apps/special-work/index.vue




//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//




/* harmony default export */ var apps_special_work = ({
  data: function data() {
    var _this = this;

    return {
      input: false,
      rightData: [{
        font: 'yt-icon yt-icon-search',
        click: function click() {
          _this.input = !_this.input;
        }
      }],
      active: [],
      items: [],
      workTypeDic: [],
      search: ''
    };
  },

  computed: {
    currentItems: function currentItems() {
      var _this2 = this;

      if (!this.search) return this.items;
      return this.items.filter(function (item) {
        return item.enterpriseName.indexOf(_this2.search) > -1;
      });
    }
  },
  activated: function activated() {
    if (this.$router.$isBack) return false;
    this.fetchData();
  },

  methods: {
    fetchData: function fetchData() {
      var _this3 = this;

      return asyncToGenerator_default()( /*#__PURE__*/regenerator_default.a.mark(function _callee() {
        var p, _ref, _ref2, entList, data, workTypeDic, obj, items;

        return regenerator_default.a.wrap(function _callee$(_context) {
          while (1) {
            switch (_context.prev = _context.next) {
              case 0:
                p = [commonApi["a" /* commonApi */].search('ent_enterprise'), commonApi["a" /* commonApi */].gql(special_work_default.a), commonApi["a" /* commonApi */].dictionary('work_type')];
                _context.next = 3;
                return _this3.$Loading.apply(_this3, p);

              case 3:
                _ref = _context.sent;
                _ref2 = slicedToArray_default()(_ref, 3);
                entList = _ref2[0];
                data = _ref2[1].data;
                workTypeDic = _ref2[2];


                _this3.workTypeDic = workTypeDic;

                obj = lodash_default.a.zipObject(data.keys, data.values);
                items = [];

                lodash_default.a.forIn(obj, function (workType, key) {
                  var ent = entList.find(function (v) {
                    return v.id === key;
                  });
                  var item = {
                    enterpriseId: ent ? ent.id : '',
                    enterpriseName: ent ? ent.EnterpriseName : '',
                    workType: lodash_default.a.zipObject(workType.keys, workType.values) || {}
                  };
                  items.push(item);
                });
                _this3.items = items;

              case 13:
              case 'end':
                return _context.stop();
            }
          }
        }, _callee, _this3);
      }))();
    },
    goListPage: function goListPage(enterpriseId, workType) {
      var a = workType ? { work_type: workType } : {};
      var b = { req_departName: enterpriseId };
      var param = extends_default()({}, a, b);
      this.$router.$push({ path: '/special-work/list', query: param });
    },
    refresh: function refresh(search) {
      this.search = search;
    }
  }
});
// CONCATENATED MODULE: ./node_modules/_vue-loader@13.7.3@vue-loader/lib/template-compiler?{"id":"data-v-24417e58","hasScoped":true,"transformToRequire":{"video":["src","poster"],"source":"src","img":"src","image":"xlink:href"},"buble":{"transforms":{}}}!./node_modules/_vue-loader@13.7.3@vue-loader/lib/selector.js?type=template&index=0!./src/apps/special-work/index.vue
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('yt-page',{attrs:{"title":"特殊作业","scroll":"","rightData":_vm.rightData,"input":_vm.input},on:{"change":_vm.refresh}},[_c('yt-collapse',{attrs:{"list":_vm.currentItems,"label":"enterpriseName"},scopedSlots:_vm._u([{key:"default",fn:function(props){return _c('div',{staticStyle:{"text-algin":"center"}},[_vm._l((_vm.workTypeDic),function(item,index){return _c('yt-cell',{key:index,attrs:{"border":"none","label":item.D_text,"isLink":""},on:{"click":function($event){return _vm.goListPage(props.enterpriseId, item.D_code)}}},[_c('span',{staticClass:"c-blue"},[_vm._v(" "+_vm._s(props.workType[item.D_code] || 0)+"  条")])])}),_vm._v(" "),_c('div',{staticClass:"yt-card-btn",on:{"click":function($event){return _vm.goListPage(props.enterpriseId, null)}}},[_c('div',{staticClass:"yt-view yt-button yt-button__blue yt-button__small is-plain is-round"},[_c('div',{staticClass:"yt-view-ripple"}),_vm._v(" "),_c('span',{staticClass:"yt-button-text"},[_vm._v("查看更多作业")])])])],2)}}]),model:{value:(_vm.active),callback:function ($$v) {_vm.active=$$v},expression:"active"}})],1)}
var staticRenderFns = []
var esExports = { render: render, staticRenderFns: staticRenderFns }
/* harmony default export */ var selectortype_template_index_0_src_apps_special_work = (esExports);
// CONCATENATED MODULE: ./src/apps/special-work/index.vue
function injectStyle (ssrContext) {
  __webpack_require__("1OdM")
}
var normalizeComponent = __webpack_require__("C7Lr")
/* script */


/* template */

/* template functional */
var __vue_template_functional__ = false
/* styles */
var __vue_styles__ = injectStyle
/* scopeId */
var __vue_scopeId__ = "data-v-24417e58"
/* moduleIdentifier (server only) */
var __vue_module_identifier__ = null
var Component = normalizeComponent(
  apps_special_work,
  selectortype_template_index_0_src_apps_special_work,
  __vue_template_functional__,
  __vue_styles__,
  __vue_scopeId__,
  __vue_module_identifier__
)

/* harmony default export */ var src_apps_special_work = __webpack_exports__["default"] = (Component.exports);


/***/ }),

/***/ "kIR6":
/***/ (function(module, exports) {

module.exports = "query fetch {\n  data: spe_tickets_managerAggregate @_(get: \"groupedBy.req_departName\") {\n    groupedBy {\n      req_departName {\n        keys\n        values @_(map: \"groupedBy.work_type\") {\n          count\n          groupedBy {\n            work_type {\n              keys\n              values @_(map: \"count\") {\n                count\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n}"

/***/ })

});